<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>主页</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.js"
            integrity="sha512-n/4gHW3atM3QqRcbCn6ewmpxcLAHGaDjpEBu4xZd47N0W2oQ+6q7oc3PXstrJYXcbNU1OHdQ1T7pAP+gi5Yu8g=="
            crossorigin="anonymous"
            referrerpolicy="no-referrer">
    </script>
    <script>
        function a1() {
            $.get({
                url: "${pageContext.request.contextPath}/a1",
                data: {'name': $("#txtName").val()},
                success: function (data, status) {
                    alert(data);
                    alert(status);
                }
            });
        }
    </script>
</head>
<body>
<%--    onblur:失去焦点触发事件--%>
用户名:<input type="text" id="txtName" onblur="a1()">
</body>
</html>
